<?php 
  include "../../config.php";
  include ADMIN_ROOT."templates/header.php";
?>
<div id="main-content">
<?php 
$serverName = "SONVU-PC\SQLEXPRESS";
$connectionInfo = array( "Database"=>"shop", "UID"=>"sa", "PWD"=>"123456" );
$conn = sqlsrv_connect( $serverName, $connectionInfo);
  $stmt= sqlsrv_query($conn,"select category_name from category");
 
?>
<form enctype="multipart/form-data" action="process.php" method="post">
  <table width="406" >
    <tr>
      <td><span>Name</span></td>
      <td><label for="txtname"></label>
      <input type="text" name="txtname" id="txtname"></td>
    </tr>
    <tr>
      <td><span>Description</span></td>
      <td><label for="textfield3"></label>
        <label for="txtdes"></label>
      <textarea name="txtdes" id="txtdes" cols="45" rows="5"></textarea></td>
    </tr>
    <tr>
      
      <td><span>cartegory_id</span></td>
      <td><label for="cartegory_id"></label>
      <select name="cateid">
        <option>---Select---</option>
        <?php 
          while (sqlsrv_fetch($stmt)){
      ?>
        <option value=""><?=sqlsrv_get_field($stmt,0)?></option>
      </select></td>
    </tr>
    <?php 
        }
    ?>
    <tr>
      <td><span>Unit Size</span></td>
      <td><label for="txtsize"></label>
      <input type="text" name="txtsize" id="txtsize"></td>
    </tr>
    <tr>
      <td><span>Unit Price</span></td>
      <td><label for="txtprice"></label>
      <input type="text" name="txtprice" id="txtprice"></td>
    </tr>
    <tr>
      <td><span>Product Available</span></td>
      <td><label for="textfield2"></label>
      <input type="text" name="txtava" id="textfield2"></td>
    </tr>
    <tr>
      <td><span>Picture</span></td>
      <td><label for="picture"></label>
      <input type="file" name="photo" id="picture"></td>
    </tr>
    <tr>
      <td><span>Note</span></td>
      <td><label for="txtnote"></label>
      <textarea name="txtnote" id="txtnote" cols="45" rows="5"></textarea></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit"  value="Save"></td>
    </tr>
  </table>
</form>

</div><!-- END content -->
      
<?php
  include ADMIN_ROOT."templates/footer.php";
?>